﻿@using FCTC_Web.Utilities
@using DAL
@using FCTC_Web.Models
@model FCTC_Web.Utilities.Page<ImageModel>
@{
    ViewBag.Title = "Index";
    int current = 0;
    string styletr = "";
}
<h2>
    图片维护列表</h2>
<p>
    @Html.ActionLink("创建", "Create" + @Url.Encode((string)ViewBag.Claim), new { relativeId = (int?)ViewBag.ClaimId})
</p>
<style>
table tr th{ padding:0px 20px;text-align:center; line-height:30px }
table tr td{ text-align:center;}
</style>
<table width="100%">
    <tr>
        <th>
            图片
        </th>
        <th>
            文件类型
        </th>
        <th>
            名称
        </th>
        <th>
            描述
        </th>
        <th>
            编辑时间
        </th>
        <th>
            编辑人
        </th>
        <th>
            操作
        </th>
    </tr>
    @foreach (var item in Model.CurrentRecords)
    {
        if (current % 2 == 1) { styletr = "background-color:#f6fdfd"; }
        else if (current % 2 == 0) { styletr = ""; }
        <tr style="@styletr">
            <td>
                <img alt="" width="100" height="75" src=@Url.Action("ShowImage", "Image", new { id = item.ID }) />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ContentType)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Description)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdateTime)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.UpdatedUser)
            </td>
            <td>
                @Html.ActionLink("编辑", "Edit" + (string)ViewBag.Claim, new { id = item.ID }) |
                @Html.ActionLink("详细信息", "Details", new { id = item.ID }) |
                @Html.ActionLink("删除", "Delete"+ (string)ViewBag.Claim, new { id = item.ID  })
            </td>
        </tr>
        current++;
    }
</table>
@Html.Pager(Model, "/image/Index" + (string)ViewBag.ClaimPage)
